<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<META http-equiv=Content-Type content="text/html; charset=gb2312">
		<link rel="stylesheet" href="${ctx}/css/common.css" type="text/css"></link>
  		<link rel="stylesheet" href="${ctx}/css/reset.css" type="text/css"></link>
  		<script type='text/javascript' src='${ctx}/dwr/interface/UserDwrManager.js'></script>
  		<script type='text/javascript' src='${ctx}/dwr/engine.js'></script>
  		<script type='text/javascript' src='${ctx}/dwr/util.js'></script>
		<LINK href="${ctx}/css/admin.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="${ctx}/js/jquery-1.7.2.js"></script>
  		<script type="text/javascript" src="${ctx}/js/jquery.easydrag.handler.beta2.js"></script>
	</HEAD>
	<BODY onload="popupDiv('pop_div')">
		<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
			<TR height=28>
				<TD background=${ctx}/images/title_bg1.jpg>
					当前位置:
				</TD>
			</TR>
			<TR>
				<TD bgColor=#b1ceef height=1></TD>
			</TR>
			<TR height=20>
				<TD background=${ctx}/images/shadow_bg.jpg></TD>
			</TR>
		</TABLE>
		<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
			<TR height=100>
				<TD align=middle width=124 height="124px">
				<img src="${ctx}/images/png-0099.png"></img>
				</TD>
				<TD width=60>
					&nbsp;
				</TD>
				<TD>
					<TABLE height=100 cellSpacing=0 cellPadding=0 width="100%" border=0>

						<TR>
							<TD>
								当前时间：2008-12-27 17:03:55
							</TD>
						</TR>
						<TR>
							<TD style="FONT-WEIGHT: bold; FONT-SIZE: 16px">
								admin
							</TD>
						</TR>
						<TR>
							<TD>
								欢迎进入网站管理中心！
							</TD>
						</TR>
					</TABLE>
				</TD>
			</TR>
			<TR>
				<TD colSpan=3 height=10></TD>
			</TR>
		</TABLE>
		<TABLE cellSpacing=0 cellPadding=0 width="95%" align=center border=0>
			<TR height=20>
				<TD></TD>
			</TR>
			<TR height=22>
				<TD style="PADDING-LEFT: 20px; FONT-WEIGHT: bold; COLOR: #ffffff"
					align=middle background=${ctx}/images/title_bg2.jpg>
					您的相关信息
				</TD>
			</TR>
			<TR bgColor=#ecf4fc height=12>
				<TD></TD>
			</TR>
			<TR height=20>
				<TD></TD>
			</TR>
		</TABLE>
		<TABLE cellSpacing=0 cellPadding=2 width="95%" align=center border=0>
			<TR>
				<TD align=right width=100>
					登陆帐号：
				</TD>
				<TD style="COLOR: #880000">
					admin
				</TD>
			</TR>
			<TR>
				<TD align=right>
					真实姓名：
				</TD>
				<TD style="COLOR: #880000">
					admin
				</TD>
			</TR>
			<TR>
				<TD align=right>
					注册时间：
				</TD>
				<TD style="COLOR: #880000">
					2007-7-25 15:02:04
				</TD>
			</TR>
			<TR>
				<TD align=right>
					登陆次数：
				</TD>
				<TD style="COLOR: #880000">
					58
				</TD>
			</TR>
			<TR>
				<TD align=right>
					上线时间：
				</TD>
				<TD style="COLOR: #880000">
					2008-12-27 17:02:54
				</TD>
			</TR>
			<TR>
				<TD align=right>
					IP地址：
				</TD>
				<TD style="COLOR: #880000">
					222.240.172.117
				</TD>
			</TR>
			
		</TABLE>
		<div id="pop_div" class="pop_box">
			<div class="p_head">
				<span class="p_h_title">用户信息修改</span> <span><a
					class="p_h_close" onclick="hideDiv('pop_div');" title="close">X</a>
				</span>
			</div>
			<div class="p_box_body" id="p_b_body">
				<div class="p_con">
					<table id="p_con_t">
					  <tr>
					    <td class="t1">用户名：</td>
					    <td><input type="text" value="<%=session.getAttribute("username") %>" id="change_name" readonly="readonly"/></td>
					  </tr>
					  <tr>
					    <td class="t1">原始密码：</td>
					    <td><input type="password" id="old_password"/></td>
					  </tr>
					  <tr>
					    <td class="t1">新密码：</td>
					    <td><input type="password" id="new_password1"/></td>
					  </tr>
					  <tr>
					    <td class="t1">确认密码：</td>
					    <td><input type="password" id="new_password2"/></td>
					  </tr>
					  <tr>
					  	<td></td>
					  	<td><input type="button" value="提交" onclick="fchangepassword()"/></td>
					  </tr>
					</table>
				</div>
			</div>
		</div>
	</BODY>
		<script type="text/javascript">
function hideDiv(div_id){
            $("#" + div_id).animate({opacity: "hide" }, 300);
}
function popupDiv(div_id) {
            var div_obj = $("#" + div_id);
            //窗口宽度,高度
            var winWidth = $(window).width();
            var winHeight = $(window).height();
            //弹出的div的宽度,高度
            var popHeight = div_obj.height();
            var popWidth = div_obj.width();
            div_obj.animate({
				 opacity: "show", left: (winWidth-popWidth)/2, top: (winHeight-popHeight)/2,width:popWidth,height:popHeight}, 300);          
}

function fchangepassword(){
	var change_name=document.getElementById("change_name").value;
	var old_password=document.getElementById("old_password").value;
	var new_password1=document.getElementById("new_password1").value;
	var new_password2=document.getElementById("new_password2").value;
	if(new_password1==""||new_password2==""||old_password==""){
		alert("请输入密码");
		return;
	}
	if(new_password1!=new_password2){
		alert("密码输入不一致");
		return;
	}
	UserDwrManager.adminupdatepassword(change_name,old_password,new_password1,function(data) {
		if(data){
			alert("密码修改成功！");
			location.href="main.jsp";
		}else{
			alert("抱歉。密码修改失败！");
		}
	});
}

$(function() {
            $(".pop_box").easydrag();
            $(".pop_box").setHandler(".pop_box .p_head");
});
</script>
</HTML>